package com.example.active.spring;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;

/**
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2020/9/17 18:34
 */
//@Component
public class ConsumerSpring
{
    @Autowired
    private JmsTemplate jmsTemplate;

    public static void main(String[] args) throws InterruptedException
    {
//        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
//        ConsumerSpring consumerSpring = (ConsumerSpring) ctx.getBean("consumerSpring");
//        String value = (String) consumerSpring.jmsTemplate.receiveAndConvert();
//        System.out.println("消费者接收到的消息是："+value);
    }
}
